package com.aps.apspda.dialog;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.widget.PopupWindow;

import com.aps.apspda.R;


/**
 * @author jaxhuang
 * @date 2017/9/27
 * @desc
 */

public class GeneralPop extends PopupWindow {

    public GeneralPop(Context context, View mView, int width, int height) {
        super(context);
        //设置PopupWindow的View
        this.setContentView(mView);
        //设置PopupWindow弹出窗体的宽
        this.setWidth(width);
        //设置PopupWindow弹出窗体的高
        this.setHeight(height);
        //设置PopupWindow弹出窗体可点击
        this.setFocusable(false);
        this.setOutsideTouchable(true);
        //设置SelectPicPopupWindow弹出窗体动画效果
        this.setAnimationStyle(R.style.PopupWindowCenterAnimation);
        //实例化一个ColorDrawable颜色为半透明
        ColorDrawable dw = new ColorDrawable(0xb0000000);
        //设置SelectPicPopupWindow弹出窗体的背景
        this.setBackgroundDrawable(dw);
    }

    public GeneralPop(Context context, View mView, int width, int height,int animation) {
        super(context);
        //设置PopupWindow的View
        this.setContentView(mView);
        //设置PopupWindow弹出窗体的宽
        this.setWidth(width);
        //设置PopupWindow弹出窗体的高
        this.setHeight(height);
        //设置PopupWindow弹出窗体可点击
        this.setFocusable(false);
        this.setOutsideTouchable(true);
        //设置SelectPicPopupWindow弹出窗体动画效果
        this.setAnimationStyle(animation);
        //实例化一个ColorDrawable颜色为半透明
        ColorDrawable dw = new ColorDrawable(0xb0000000);
        //设置SelectPicPopupWindow弹出窗体的背景
        this.setBackgroundDrawable(dw);
    }
}
